package org.jcb;

import android.graphics.Point;





public class Circle {
    public int x;
    public int y;
    public int radius ;

    public Circle(int newX, int newY, int radius) {
        x = newX;
        y = newY;
        this.radius = radius ; 
    }

    public boolean equals(Circle other) {
        if (x == other.x && y == other.y) {
            return true;
        }
        return false;
    }

    public boolean inside(Point p) {
    	System.out.println("circle " + this.toString() + " point " + p.toString());
    	float xi = p.x - x ;
		float yi = p.y - y ;
		double distance =  Math.pow(Math.pow((double)xi, 2) + Math.pow((double)yi,2),0.5)  ;				
		return (distance <= radius) ;
    }

    
    @Override
    public String toString() {
        return "Circle: [" + x + "," + y + "," + radius + "]";
    }
    
    public static void main(String args[]) {
    	Circle test = new Circle(0,0,100) ;
    	Point p1 = new Point (0,0) ;
    	System.out.println(test.inside(p1));
    }
    
    
}